-- | Extra library functions for HXT.
module Text.XML.HXT.Extras(
                     showPickled,
                     textAttr,
                     xp7Tuple,
                     xp8Tuple,
                     xp9Tuple,
                     xp10Tuple,
                     xp11Tuple,
                     xp12Tuple,
                     xp13Tuple,
                     xp14Tuple,
                     xp15Tuple,
                     xp16Tuple,
                     xp17Tuple,
                     xp18Tuple,
                     xp19Tuple,
                     xp20Tuple,
                     xp21Tuple,
                     xp22Tuple,
                     xp23Tuple,
                     xp24Tuple,
                     xunpickleString
                   ) where

import Text.XML.HXT.Core

-- | A text attribute.
textAttr :: String -> PU String
textAttr = flip xpAttr xpText

xunpickleString ::
  PU a
  -> SysConfigList
  -> String
  -> IOStateArrow s b a
xunpickleString xp al src =
  readString al src    
  >>>
  xunpickleVal xp
